<template>
	<view class="container">
		<uni-section title="食物图片" sub-title="" type="square">
			<image :src="'/static/'+data.icon" mode="widthFix"></image>
		</uni-section>
		<uni-section title="食物名称" sub-title="" type="square">
			{{data.name}}
		</uni-section>
		<uni-section title="食物类别" sub-title="" type="square">
			{{data.type}}
		</uni-section>
		<uni-section title="食物价格" sub-title="" type="square">
			￥{{data.price}}元
		</uni-section>
		<uni-section title="食物介绍" sub-title="" type="square">
			{{data.description}}
		</uni-section>
		<uni-section title="菜品评论" sub-title="" type="square">
			<navigator url="../comment/addcomment" open-type="navigate"><button type="default">发表评论</button></navigator>
			<strong><navigator :url="'../comment/commentlist?foodid='+data.id" open-type="navigate"><button type="default">查看评论</button></navigator></strong>
		</uni-section>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: {
					
				}
			}
		},
		methods: {

		},
		onLoad(e) {
			let id = e.id
			uni.request({
				url: 'http://localhost:8090/foodapp/food/findone',
				method: 'POST',
				data: {
					id: id
				},
				success: res => {
					this.data = res.data.data
				},
				fail: () => {},
				complete: () => {}
			});
		}
	}
</script>

<style>
	.container {
		padding: 10px;
		font-size: 14px;
		line-height: 24px;
	}
</style>